-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Add generic JWT auth #20928
base: master
Are you sure you want to change the base?
feat: Add generic JWT auth #20928
Conversation
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
🔴 Preview Environment stopped on BunnyshellSee: Environment Details | Pipeline Logs Available commands (reply to this comment):
|
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #20928 +/- ##
==========================================
- Coverage 55.19% 53.25% -1.95%
==========================================
Files 337 337
Lines 57058 57177 +119
==========================================
- Hits 31496 30451 -1045
- Misses 22863 24049 +1186
+ Partials 2699 2677 -22 ☔ View full report in Codecov by Sentry. |
Signed-off-by: Wes Medford <[email protected]>
That's cool, but shouldn't we at least verify a configurable |
Good call, and completely agree. Will add that as a config option. |
…e audiences Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Added! |
Signed-off-by: Wes Medford <[email protected]>
Co-authored-by: Josh Soref <[email protected]> Signed-off-by: Wes <[email protected]>
Co-authored-by: Josh Soref <[email protected]> Signed-off-by: Wes <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
Signed-off-by: Wes Medford <[email protected]>
|
||
gooidc "github.com/coreos/go-oidc/v3/oidc" | ||
"github.com/golang-jwt/jwt/v4" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use jwt v5.
p.jwksExpiry = time.Now().Add(cacheTTL) | ||
|
||
return &jwks, nil | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm a bit hesitant of having our own implementation of verification. Is it possible to use some libraries for that? E.g. would this https://pkg.go.dev/gopkg.in/square/go-jose.v2/jwt#Claims.Validate be useful?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea that's fair. I'll swap that out.
return token.Claims, "", nil | ||
} | ||
// If JWT verification fails, continue with other methods | ||
log.Debugf("JWT verification failed, trying other methods: %v", err) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we continue with other methods instead of failing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Argo signs its own JWT, so this is for native auth (e.g. admin login for breakglass) we wouldn't want to block that auth just because JWT auth is configured.
Closes #14250
This allows for generic JWTs to be used for authentication that are minted outside of Argo. Argo currently mints its own JWTs for auth outside of Dex, and this extends its capabilities to utilize JWTs that originate from Identity Aware Proxies.
Checklist: